#include	<stdio.h>
#include	<stdlib.h>
#include	<string.h>
#include    <unistd.h>
#include    <sys/types.h>
#include    <sys/wait.h>

#define	MAXARGS		20				
#define	ARGLEN		100				

int execute( char *arglist[] )
{
	execvp(arglist[0], arglist);		
	perror("execvp failed");
	exit(1);
}
void child_code(char *arglist[])
{
	int flag=0;
	flag=fork();
	wait(NULL);
	if(flag==0)execute( arglist );
	else	
	return;
}
int main()
{
	char	*arglist[MAXARGS+1];		
	int		numargs;			
	char	argbuf[ARGLEN];			

	numargs = 0;
	while ( numargs < MAXARGS )
	{					
		printf("> ");
		if ( scanf("%s",)
			arglist[numargs++] = makestring(argbuf);
		else
		{
			if ( numargs > 0 ){		
				arglist[numargs]=NULL;
				child_code(arglist);
				numargs = 0;		
			}
		}
	}
	return 0;
}


